package org.wangp.framework.core.util

import cn.hutool.core.util.ObjectUtil
import cn.hutool.core.util.StrUtil
import org.modelmapper.ModelMapper
import org.modelmapper.convention.MatchingStrategies
import org.slf4j.Logger
import java.util.*

/**
 * @author wangpeng (๑•ᴗ•๑)
 * @date 2021/10/10 18:00
 */
val modelMapper = ModelMapper().apply {
	configuration.apply {
		// 深度复制
		isDeepCopyEnabled = true
		// 严格匹配
		isFullTypeMatchingRequired = true
		matchingStrategy = MatchingStrategies.STRICT
	}
}

//下划线转驼峰
fun CharSequence.camelCase(): String = StrUtil.toCamelCase(this)

//驼峰转下划线
fun CharSequence.underlineCase(): String = StrUtil.toUnderlineCase(this)

fun Logger.infoAny(any: Any) = this.info(ObjectUtil.toString(any))
fun Logger.debugAny(any: Any) = this.debug(ObjectUtil.toString(any))
